class StatusUtils {
  StatusUtils._privateConstructor();

  static String getCarStatus(int st) {
    if (st == -1) {
      return "已删除";
    } else if (st == 1) {
      return "可执行";
    } else if (st == 2  || st == 5) {
      return "空闲中";
    } else if (st == 3) {
      return "任务中";
    } else {
      return "其它";
    }
  }

  static String getOrderMode(int? mode) {
    if (mode == 1) {
      return "自动";
    } else if (mode == 2) {
      return "手动";
    } else {
      return "未知";
    }
  }

  static String getDriveMode(int? drive_mode) {
    if (drive_mode == 1) {
      return "人工驾驶";
    } else if (drive_mode == 2) {
      return "自动驾驶";
    } else if (drive_mode == 3) {
      return "人工派车";
    } else {
      return "未知";
    }
  }

  //  待揽收   status=3 && mission_status in 1,2,3
  //  配送中   status=3 && mission_status in 3,5,6,7
  //  已完成   status=4 && mission_status=9
  //1 装货, 2 卸货, 3 完成, 4 取消
  static int getOrderStatus(int? status, int? mission_status) {
    if ((status == 3 || status == 22 || status == 23) && (mission_status == 1 || mission_status == 2 || mission_status == 3)){
      return 1;
    } else if ((status == 3 || status == 22 || status == 23) && (mission_status == 5 || mission_status == 6 || mission_status == 7)){
      return 2;
    } else if(status ==4 && mission_status == 9){
      return 3; // 直接不显示按钮吧(正常情况下,这个应该是已完成,不显示按钮,不可点击卸货完成)
    } else if (status == 23) {
      return 4; // 商户已取消订单(不能再点击装货,卸货了)
    }
    return 3;
  }

  static String getPayType(dynamic payType) {
    if (payType == 1) {
      return "套餐抵扣";
    } else if (payType == 2) {
      return "余额支付";
    } else if (payType == 3) {
      return "微信支付";
    } else {
      return "未知";
    }
  }
}